/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('dm', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddIpfilterRequest {
  ipAddress?: string(name='IpAddress', description='This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model AddIpfilterResponseBody = {
  ipFilterId?: string(name='IpFilterId', example='10795'),
  requestId?: string(name='RequestId', example='0E9282E8-DC08-5445-8FB0-B9F0CA28B249'),
}

model AddIpfilterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AddIpfilterResponseBody(name='body'),
}

/**
 * @summary 添加IP防护信息
 *
 * @param request AddIpfilterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AddIpfilterResponse
 */
async function addIpfilterWithOptions(request: AddIpfilterRequest, runtime: Util.RuntimeOptions): AddIpfilterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipAddress)) {
    query['IpAddress'] = request.ipAddress;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddIpfilter',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 添加IP防护信息
 *
 * @param request AddIpfilterRequest
 * @return AddIpfilterResponse
 */
async function addIpfilter(request: AddIpfilterRequest): AddIpfilterResponse {
  var runtime = new Util.RuntimeOptions{};
  return addIpfilterWithOptions(request, runtime);
}

model ApproveReplyMailAddressRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  ticket?: string(name='Ticket', description='This parameter is required.'),
}

model ApproveReplyMailAddressResponseBody = {
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model ApproveReplyMailAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ApproveReplyMailAddressResponseBody(name='body'),
}

/**
 * @summary 验证回信地址
 *
 * @param request ApproveReplyMailAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ApproveReplyMailAddressResponse
 */
async function approveReplyMailAddressWithOptions(request: ApproveReplyMailAddressRequest, runtime: Util.RuntimeOptions): ApproveReplyMailAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.ticket)) {
    query['Ticket'] = request.ticket;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ApproveReplyMailAddress',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 验证回信地址
 *
 * @param request ApproveReplyMailAddressRequest
 * @return ApproveReplyMailAddressResponse
 */
async function approveReplyMailAddress(request: ApproveReplyMailAddressRequest): ApproveReplyMailAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return approveReplyMailAddressWithOptions(request, runtime);
}

model BatchSendMailRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='test@example.com'),
  addressType?: int32(name='AddressType', description='This parameter is required.', example='1'),
  clickTrace?: string(name='ClickTrace', example='0'),
  headers?: string(name='Headers'),
  ownerId?: long(name='OwnerId'),
  receiversName?: string(name='ReceiversName', description='This parameter is required.', example='test2'),
  replyAddress?: string(name='ReplyAddress'),
  replyAddressAlias?: string(name='ReplyAddressAlias'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagName?: string(name='TagName', example='test3'),
  templateName?: string(name='TemplateName', description='This parameter is required.', example='test1'),
  unSubscribeFilterLevel?: string(name='UnSubscribeFilterLevel'),
  unSubscribeLinkType?: string(name='UnSubscribeLinkType'),
}

model BatchSendMailResponseBody = {
  envId?: string(name='EnvId', example='xxx'),
  requestId?: string(name='RequestId', example='12D086F6-8F31-4658-84C1-006DED011A85'),
}

model BatchSendMailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BatchSendMailResponseBody(name='body'),
}

/**
 * @summary 批量发送邮件
 *
 * @param request BatchSendMailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return BatchSendMailResponse
 */
async function batchSendMailWithOptions(request: BatchSendMailRequest, runtime: Util.RuntimeOptions): BatchSendMailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.addressType)) {
    query['AddressType'] = request.addressType;
  }
  if (!Util.isUnset(request.clickTrace)) {
    query['ClickTrace'] = request.clickTrace;
  }
  if (!Util.isUnset(request.headers)) {
    query['Headers'] = request.headers;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.receiversName)) {
    query['ReceiversName'] = request.receiversName;
  }
  if (!Util.isUnset(request.replyAddress)) {
    query['ReplyAddress'] = request.replyAddress;
  }
  if (!Util.isUnset(request.replyAddressAlias)) {
    query['ReplyAddressAlias'] = request.replyAddressAlias;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  if (!Util.isUnset(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!Util.isUnset(request.unSubscribeFilterLevel)) {
    query['UnSubscribeFilterLevel'] = request.unSubscribeFilterLevel;
  }
  if (!Util.isUnset(request.unSubscribeLinkType)) {
    query['UnSubscribeLinkType'] = request.unSubscribeLinkType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchSendMail',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 批量发送邮件
 *
 * @param request BatchSendMailRequest
 * @return BatchSendMailResponse
 */
async function batchSendMail(request: BatchSendMailRequest): BatchSendMailResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchSendMailWithOptions(request, runtime);
}

model CheckDomainRequest {
  domainId?: int32(name='DomainId', description='The ID of the domain name.

This parameter is required.', example='153345'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CheckDomainResponseBody = {
  domainStatus?: int32(name='DomainStatus', description='The status of the domain name. Indicates whether the domain name is verified and available.

*   0: indicates that the domain name is verified and available.
*   1: indicates that the domain name fails to be verified and is unavailable.
*   2: indicates that the domain name is available, but not filed or configured with a CNAME record.
*   3: indicates that the domain name is available but not filed.
*   4: indicates that the domain name is available but not configured with a CNAME record.', example='1'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='F0B82E83-A1D9-4FE6-97D2-F4B231F80B02'),
}

model CheckDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckDomainResponseBody(name='body'),
}

/**
 * @summary 校验域名状态
 *
 * @param request CheckDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckDomainResponse
 */
async function checkDomainWithOptions(request: CheckDomainRequest, runtime: Util.RuntimeOptions): CheckDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainId)) {
    query['DomainId'] = request.domainId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckDomain',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 校验域名状态
 *
 * @param request CheckDomainRequest
 * @return CheckDomainResponse
 */
async function checkDomain(request: CheckDomainRequest): CheckDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkDomainWithOptions(request, runtime);
}

model CheckReplyToMailAddressRequest {
  lang?: string(name='Lang'),
  mailAddressId?: int32(name='MailAddressId', description='This parameter is required.', example='126545'),
  ownerId?: long(name='OwnerId'),
  region?: string(name='Region', example='cn-hangzhou'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CheckReplyToMailAddressResponseBody = {
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model CheckReplyToMailAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckReplyToMailAddressResponseBody(name='body'),
}

/**
 * @summary 校验回信地址
 *
 * @param request CheckReplyToMailAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CheckReplyToMailAddressResponse
 */
async function checkReplyToMailAddressWithOptions(request: CheckReplyToMailAddressRequest, runtime: Util.RuntimeOptions): CheckReplyToMailAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.lang)) {
    query['Lang'] = request.lang;
  }
  if (!Util.isUnset(request.mailAddressId)) {
    query['MailAddressId'] = request.mailAddressId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckReplyToMailAddress',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 校验回信地址
 *
 * @param request CheckReplyToMailAddressRequest
 * @return CheckReplyToMailAddressResponse
 */
async function checkReplyToMailAddress(request: CheckReplyToMailAddressRequest): CheckReplyToMailAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkReplyToMailAddressWithOptions(request, runtime);
}

model CreateDomainRequest {
  domainName?: string(name='DomainName', description='This parameter is required.', example='abc.com'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateDomainResponseBody = {
  domainId?: string(name='DomainId', example='158910'),
  requestId?: string(name='RequestId', example='B49AD828-25D1-488C-90B7-8853C1944486'),
}

model CreateDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateDomainResponseBody(name='body'),
}

/**
 * @summary 创建域名
 *
 * @param request CreateDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateDomainResponse
 */
async function createDomainWithOptions(request: CreateDomainRequest, runtime: Util.RuntimeOptions): CreateDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateDomain',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建域名
 *
 * @param request CreateDomainRequest
 * @return CreateDomainResponse
 */
async function createDomain(request: CreateDomainRequest): CreateDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return createDomainWithOptions(request, runtime);
}

model CreateMailAddressRequest {
  accountName?: string(name='AccountName', description='This parameter is required.'),
  ownerId?: long(name='OwnerId'),
  replyAddress?: string(name='ReplyAddress', example='reply@aliyun.com'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendtype?: string(name='Sendtype', description='This parameter is required.', example='batch'),
}

model CreateMailAddressResponseBody = {
  mailAddressId?: string(name='MailAddressId', example='xxx'),
  requestId?: string(name='RequestId', example='95A7D497-F8DD-4834-B81E-C1783236E55F'),
}

model CreateMailAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateMailAddressResponseBody(name='body'),
}

/**
 * @param request CreateMailAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateMailAddressResponse
 */
async function createMailAddressWithOptions(request: CreateMailAddressRequest, runtime: Util.RuntimeOptions): CreateMailAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.replyAddress)) {
    query['ReplyAddress'] = request.replyAddress;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sendtype)) {
    query['Sendtype'] = request.sendtype;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateMailAddress',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateMailAddressRequest
 * @return CreateMailAddressResponse
 */
async function createMailAddress(request: CreateMailAddressRequest): CreateMailAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return createMailAddressWithOptions(request, runtime);
}

model CreateReceiverRequest {
  desc?: string(name='Desc'),
  ownerId?: long(name='OwnerId'),
  receiversAlias?: string(name='ReceiversAlias', description='This parameter is required.', example='vme'),
  receiversName?: string(name='ReceiversName', description='This parameter is required.', example='xme'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateReceiverResponseBody = {
  receiverId?: string(name='ReceiverId', example='xxxx'),
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model CreateReceiverResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateReceiverResponseBody(name='body'),
}

/**
 * @summary 创建收件人列表
 *
 * @param request CreateReceiverRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateReceiverResponse
 */
async function createReceiverWithOptions(request: CreateReceiverRequest, runtime: Util.RuntimeOptions): CreateReceiverResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.desc)) {
    query['Desc'] = request.desc;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.receiversAlias)) {
    query['ReceiversAlias'] = request.receiversAlias;
  }
  if (!Util.isUnset(request.receiversName)) {
    query['ReceiversName'] = request.receiversName;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateReceiver',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建收件人列表
 *
 * @param request CreateReceiverRequest
 * @return CreateReceiverResponse
 */
async function createReceiver(request: CreateReceiverRequest): CreateReceiverResponse {
  var runtime = new Util.RuntimeOptions{};
  return createReceiverWithOptions(request, runtime);
}

model CreateTagRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagDescription?: string(name='TagDescription'),
  tagName?: string(name='TagName', description='This parameter is required.', example='vme'),
}

model CreateTagResponseBody = {
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
  tagId?: string(name='TagId', example='xxxx'),
}

model CreateTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateTagResponseBody(name='body'),
}

/**
 * @summary 创建标签
 *
 * @param request CreateTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateTagResponse
 */
async function createTagWithOptions(request: CreateTagRequest, runtime: Util.RuntimeOptions): CreateTagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagDescription)) {
    query['TagDescription'] = request.tagDescription;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateTag',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 创建标签
 *
 * @param request CreateTagRequest
 * @return CreateTagResponse
 */
async function createTag(request: CreateTagRequest): CreateTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return createTagWithOptions(request, runtime);
}

model CreateUserSuppressionRequest {
  address?: string(name='Address', description='Email address or domain name', example='test@example.net'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model CreateUserSuppressionResponseBody = {
  requestId?: string(name='RequestId', description='Request ID', example='1A846D66-5EC7-551B-9687-5BF1963DCFC1'),
  suppressionId?: string(name='SuppressionId', description='Invalid address number', example='59511'),
}

model CreateUserSuppressionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUserSuppressionResponseBody(name='body'),
}

/**
 * @summary Create User\\"s Invalid Address
 *
 * @param request CreateUserSuppressionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateUserSuppressionResponse
 */
async function createUserSuppressionWithOptions(request: CreateUserSuppressionRequest, runtime: Util.RuntimeOptions): CreateUserSuppressionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateUserSuppression',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Create User\\"s Invalid Address
 *
 * @param request CreateUserSuppressionRequest
 * @return CreateUserSuppressionResponse
 */
async function createUserSuppression(request: CreateUserSuppressionRequest): CreateUserSuppressionResponse {
  var runtime = new Util.RuntimeOptions{};
  return createUserSuppressionWithOptions(request, runtime);
}

model DeleteDomainRequest {
  domainId?: int32(name='DomainId', description='This parameter is required.', example='326***'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteDomainResponseBody = {
  requestId?: string(name='RequestId', example='E3DFF97B-00CF-5333-8125-3D6819471984'),
}

model DeleteDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteDomainResponseBody(name='body'),
}

/**
 * @summary 删除域名
 *
 * @param request DeleteDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteDomainResponse
 */
async function deleteDomainWithOptions(request: DeleteDomainRequest, runtime: Util.RuntimeOptions): DeleteDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainId)) {
    query['DomainId'] = request.domainId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteDomain',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除域名
 *
 * @param request DeleteDomainRequest
 * @return DeleteDomainResponse
 */
async function deleteDomain(request: DeleteDomainRequest): DeleteDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteDomainWithOptions(request, runtime);
}

model DeleteInvalidAddressRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  toAddress?: string(name='ToAddress', example='test1***@example.net'),
}

model DeleteInvalidAddressResponseBody = {
  requestId?: string(name='RequestId', example='2D086F6-xxxx-xxxx-xxxx-006DED011A85'),
}

model DeleteInvalidAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteInvalidAddressResponseBody(name='body'),
}

/**
 * @summary 从无效地址库删除无效地址
 *
 * @param request DeleteInvalidAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteInvalidAddressResponse
 */
async function deleteInvalidAddressWithOptions(request: DeleteInvalidAddressRequest, runtime: Util.RuntimeOptions): DeleteInvalidAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.toAddress)) {
    query['ToAddress'] = request.toAddress;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteInvalidAddress',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 从无效地址库删除无效地址
 *
 * @param request DeleteInvalidAddressRequest
 * @return DeleteInvalidAddressResponse
 */
async function deleteInvalidAddress(request: DeleteInvalidAddressRequest): DeleteInvalidAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteInvalidAddressWithOptions(request, runtime);
}

model DeleteIpfilterByEdmIdRequest {
  fromType?: int32(name='FromType'),
  id?: string(name='Id', example='10120'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteIpfilterByEdmIdResponseBody = {
  requestId?: string(name='RequestId', example='E3DFF97B-00CF-5333-8125-3D6819471984'),
}

model DeleteIpfilterByEdmIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteIpfilterByEdmIdResponseBody(name='body'),
}

/**
 * @summary 删除IP保护信息
 *
 * @param request DeleteIpfilterByEdmIdRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteIpfilterByEdmIdResponse
 */
async function deleteIpfilterByEdmIdWithOptions(request: DeleteIpfilterByEdmIdRequest, runtime: Util.RuntimeOptions): DeleteIpfilterByEdmIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.fromType)) {
    query['FromType'] = request.fromType;
  }
  if (!Util.isUnset(request.id)) {
    query['Id'] = request.id;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteIpfilterByEdmId',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除IP保护信息
 *
 * @param request DeleteIpfilterByEdmIdRequest
 * @return DeleteIpfilterByEdmIdResponse
 */
async function deleteIpfilterByEdmId(request: DeleteIpfilterByEdmIdRequest): DeleteIpfilterByEdmIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteIpfilterByEdmIdWithOptions(request, runtime);
}

model DeleteMailAddressRequest {
  mailAddressId?: int32(name='MailAddressId', description='This parameter is required.', example='23457'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteMailAddressResponseBody = {
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model DeleteMailAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteMailAddressResponseBody(name='body'),
}

/**
 * @summary 删除发信地址
 *
 * @param request DeleteMailAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteMailAddressResponse
 */
async function deleteMailAddressWithOptions(request: DeleteMailAddressRequest, runtime: Util.RuntimeOptions): DeleteMailAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mailAddressId)) {
    query['MailAddressId'] = request.mailAddressId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteMailAddress',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除发信地址
 *
 * @param request DeleteMailAddressRequest
 * @return DeleteMailAddressResponse
 */
async function deleteMailAddress(request: DeleteMailAddressRequest): DeleteMailAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteMailAddressWithOptions(request, runtime);
}

model DeleteReceiverRequest {
  ownerId?: long(name='OwnerId'),
  receiverId?: string(name='ReceiverId', description='The ID of the recipient list.

This parameter is required.', example='1453'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteReceiverResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model DeleteReceiverResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteReceiverResponseBody(name='body'),
}

/**
 * @summary 删除收件人列表
 *
 * @param request DeleteReceiverRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteReceiverResponse
 */
async function deleteReceiverWithOptions(request: DeleteReceiverRequest, runtime: Util.RuntimeOptions): DeleteReceiverResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.receiverId)) {
    query['ReceiverId'] = request.receiverId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteReceiver',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除收件人列表
 *
 * @param request DeleteReceiverRequest
 * @return DeleteReceiverResponse
 */
async function deleteReceiver(request: DeleteReceiverRequest): DeleteReceiverResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteReceiverWithOptions(request, runtime);
}

model DeleteReceiverDetailRequest {
  email?: string(name='Email'),
  ownerId?: long(name='OwnerId'),
  receiverId?: string(name='ReceiverId', description='This parameter is required.', example='123534'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DeleteReceiverDetailResponseBody = {
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model DeleteReceiverDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteReceiverDetailResponseBody(name='body'),
}

/**
 * @summary 删除单个收件人
 *
 * @param request DeleteReceiverDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteReceiverDetailResponse
 */
async function deleteReceiverDetailWithOptions(request: DeleteReceiverDetailRequest, runtime: Util.RuntimeOptions): DeleteReceiverDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.email)) {
    query['Email'] = request.email;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.receiverId)) {
    query['ReceiverId'] = request.receiverId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteReceiverDetail',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除单个收件人
 *
 * @param request DeleteReceiverDetailRequest
 * @return DeleteReceiverDetailResponse
 */
async function deleteReceiverDetail(request: DeleteReceiverDetailRequest): DeleteReceiverDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteReceiverDetailWithOptions(request, runtime);
}

model DeleteTagRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagId?: int32(name='TagId', description='The ID of the tag.

This parameter is required.', example='123'),
}

model DeleteTagResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model DeleteTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteTagResponseBody(name='body'),
}

/**
 * @summary 删除标签
 *
 * @param request DeleteTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteTagResponse
 */
async function deleteTagWithOptions(request: DeleteTagRequest, runtime: Util.RuntimeOptions): DeleteTagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagId)) {
    query['TagId'] = request.tagId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteTag',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除标签
 *
 * @param request DeleteTagRequest
 * @return DeleteTagResponse
 */
async function deleteTag(request: DeleteTagRequest): DeleteTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteTagWithOptions(request, runtime);
}

model DescAccountSummaryRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescAccountSummaryResponseBody = {
  dailyQuota?: int32(name='DailyQuota', description='Daily quota', example='2000'),
  dailyRemainFreeQuota?: int32(name='DailyRemainFreeQuota', description='remaining amount of daily free quota', example='100'),
  dayuStatus?: int32(name='DayuStatus', description='Dayu status (deprecated, retained for compatibility reasons.)', example='0'),
  domains?: int32(name='Domains', description='Number of domains', example='1'),
  enableTimes?: int32(name='EnableTimes', description='Effective time', example='0'),
  mailAddresses?: int32(name='MailAddresses', description='Number of sending addresses', example='0'),
  maxQuotaLevel?: int32(name='MaxQuotaLevel', description='Maximum level', example='10'),
  monthQuota?: int32(name='MonthQuota', description='Monthly quota', example='60000'),
  quotaLevel?: int32(name='QuotaLevel', description='Credit level', example='2'),
  receivers?: int32(name='Receivers', description='Number of recipients', example='0'),
  remainFreeQuota?: int32(name='RemainFreeQuota', description='Remaining amount of total free quota', example='1910'),
  requestId?: string(name='RequestId', description='Request ID', example='82B295BB-7E69-491F-9896-ECEAFF09E1A4'),
  smsRecord?: int32(name='SmsRecord', description='Deprecated, retained for compatibility reasons.', example='0'),
  smsSign?: int32(name='SmsSign', description='Deprecated, retained for compatibility reasons.', example='0'),
  smsTemplates?: int32(name='SmsTemplates', description='Deprecated, retained for compatibility reasons.', example='0'),
  tags?: int32(name='Tags', description='Number of tags', example='0'),
  templates?: int32(name='Templates', description='Number of templates', example='1'),
  userStatus?: int32(name='UserStatus', description='User status:
1 Frozen
2 In arrears
4 Restricted from sending
8 Logically deleted', example='0'),
}

model DescAccountSummaryResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescAccountSummaryResponseBody(name='body'),
}

/**
 * @summary Retrieve account information.
 *
 * @param request DescAccountSummaryRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescAccountSummaryResponse
 */
async function descAccountSummaryWithOptions(request: DescAccountSummaryRequest, runtime: Util.RuntimeOptions): DescAccountSummaryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescAccountSummary',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Retrieve account information.
 *
 * @param request DescAccountSummaryRequest
 * @return DescAccountSummaryResponse
 */
async function descAccountSummary(request: DescAccountSummaryRequest): DescAccountSummaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return descAccountSummaryWithOptions(request, runtime);
}

model DescDomainRequest {
  domainId?: int32(name='DomainId', description='The ID of the domain name.

This parameter is required.', example='13464'),
  ownerId?: long(name='OwnerId'),
  requireRealTimeDnsRecords?: boolean(name='RequireRealTimeDnsRecords', description='Determine whether to perform real-time DNS resolution', example='true'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model DescDomainResponseBody = {
  cnameAuthStatus?: string(name='CnameAuthStatus', description='Track verification', example='1'),
  cnameConfirmStatus?: string(name='CnameConfirmStatus', description='CName verification flag, success: 0, failure: 1.', example='0'),
  cnameRecord?: string(name='CnameRecord', description='CNAME records', example='dmtrace'),
  createTime?: string(name='CreateTime', description='Creation time', example='2019-09-29T12:49Z'),
  defaultDomain?: string(name='DefaultDomain', description='Default domain name', example='0'),
  dkimAuthStatus?: string(name='DkimAuthStatus', description='DKIM validation flag, success: 0, failure: 1.', example='0'),
  dkimPublicKey?: string(name='DkimPublicKey', description='DKIM public key', example='v=DKIM1; k=rsa; p=MIGfMA0GCSqGSI...'),
  dkimRR?: string(name='DkimRR', description='DKIM HostRecord', example='aliyun-cn-hangzhou._domainkey.hangzhou26'),
  dmarcAuthStatus?: int32(name='DmarcAuthStatus', description='DMARC validation flag, success: 0, failure: 1.', example='1'),
  dmarcHostRecord?: string(name='DmarcHostRecord', description='DMARC host record', example='_dmarc.xxx'),
  dmarcRecord?: string(name='DmarcRecord', description='DMARC record', example='v=DMARC1;p=none;rua=mailto:dmarc_report@service.aliyun.com'),
  dnsDmarc?: string(name='DnsDmarc', description='dmarc record value resolved through public DNS', example='v=DMARC1;p=none;rua=mailto:dmarc_report@service.aliyun.com'),
  dnsMx?: string(name='DnsMx', description='MX record value resolved through public DNS', example='abc-com.xxxx.com'),
  dnsSpf?: string(name='DnsSpf', description='SPF record value resolved through public DNS', example='v=xxxx'),
  dnsTxt?: string(name='DnsTxt', description='TXT record value resolved through public DNS.', example='121309ohdsa'),
  domainId?: string(name='DomainId', description='The ID of the domain name.', example='158910'),
  domainName?: string(name='DomainName', description='domain', example='example.net'),
  domainStatus?: string(name='DomainStatus', description='The status of the domain name. Indicates whether the domain name is verified and available. Valid values:

0: indicates that the domain name is verified and available.

1: indicates that the domain name fails to be verified and is unavailable.

2: indicates that the domain name is available, but not filed or configured with a CNAME record.

3: indicates that the domain name is available but not filed.

4: indicates that the domain name is available but not configured with a CNAME record.', example='1'),
  domainType?: string(name='DomainType', description='TXT records provided by the Direct Mail console.', example='0c40d5f125af4e42892a'),
  hostRecord?: string(name='HostRecord', description='host record', example='xxx'),
  icpStatus?: string(name='IcpStatus', description='Filing status. 1 indicates that it has been filed, and 0 indicates that it has not been filed.', example='1'),
  mxAuthStatus?: string(name='MxAuthStatus', description='MX validation flag, success: 0, failure: 1.', example='1'),
  mxRecord?: string(name='MxRecord', description='MX record', example='mx01.dm.aliyun.com'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='51B74264-46B4-43C8-A9A0-6B8E8BC04F34'),
  spfAuthStatus?: string(name='SpfAuthStatus', description='SPF validation flag, success: 0, failure: 1.', example='1'),
  spfRecord?: string(name='SpfRecord', description='Spf record', example='include:spf1.dm.aliyun.com'),
  spfRecordV2?: string(name='SpfRecordV2', description='SpfRecord', example='v=spf1 include:spf1.dm.aliyun.com -all'),
  tlDomainName?: string(name='TlDomainName', description='The primary domain name.', example='example.net'),
  tracefRecord?: string(name='TracefRecord', description='The CNAME verification record provided by the Direct Mail console.', example='tracedm.aliyuncs.com'),
}

model DescDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescDomainResponseBody(name='body'),
}

/**
 * @summary 获取域名详情
 *
 * @param request DescDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescDomainResponse
 */
async function descDomainWithOptions(request: DescDomainRequest, runtime: Util.RuntimeOptions): DescDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainId)) {
    query['DomainId'] = request.domainId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.requireRealTimeDnsRecords)) {
    query['RequireRealTimeDnsRecords'] = request.requireRealTimeDnsRecords;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescDomain',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取域名详情
 *
 * @param request DescDomainRequest
 * @return DescDomainResponse
 */
async function descDomain(request: DescDomainRequest): DescDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return descDomainWithOptions(request, runtime);
}

model GetIpProtectionRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetIpProtectionResponseBody = {
  ipProtection?: string(name='IpProtection', example='0'),
  requestId?: string(name='RequestId', example='B30E5A62-2E64-577D-A70E-8C6781D6C975'),
}

model GetIpProtectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIpProtectionResponseBody(name='body'),
}

/**
 * @summary 获取IP保护信息
 *
 * @param request GetIpProtectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIpProtectionResponse
 */
async function getIpProtectionWithOptions(request: GetIpProtectionRequest, runtime: Util.RuntimeOptions): GetIpProtectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIpProtection',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取IP保护信息
 *
 * @param request GetIpProtectionRequest
 * @return GetIpProtectionResponse
 */
async function getIpProtection(request: GetIpProtectionRequest): GetIpProtectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIpProtectionWithOptions(request, runtime);
}

model GetIpfilterListRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetIpfilterListResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='84DD77C7-A091-5139-9530-2D1F7CCE59E0'),
  totalCount?: int32(name='TotalCount', example='1'),
  data?: {
    ipfilters?: [ 
    {
      createTime?: string(name='CreateTime', example='1653547140'),
      id?: string(name='Id', example='10083'),
      ipAddress?: string(name='IpAddress'),
    }
  ](name='ipfilters')
  }(name='data'),
}

model GetIpfilterListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetIpfilterListResponseBody(name='body'),
}

/**
 * @summary 获取IP防护信息
 *
 * @param request GetIpfilterListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetIpfilterListResponse
 */
async function getIpfilterListWithOptions(request: GetIpfilterListRequest, runtime: Util.RuntimeOptions): GetIpfilterListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIpfilterList',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取IP防护信息
 *
 * @param request GetIpfilterListRequest
 * @return GetIpfilterListResponse
 */
async function getIpfilterList(request: GetIpfilterListRequest): GetIpfilterListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIpfilterListWithOptions(request, runtime);
}

model GetSuppressionListLevelRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model GetSuppressionListLevelResponseBody = {
  requestId?: string(name='RequestId'),
  suppressionListLevel?: string(name='SuppressionListLevel'),
}

model GetSuppressionListLevelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSuppressionListLevelResponseBody(name='body'),
}

/**
 * @summary 获取用户无效地址级别配置
 *
 * @param request GetSuppressionListLevelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSuppressionListLevelResponse
 */
async function getSuppressionListLevelWithOptions(request: GetSuppressionListLevelRequest, runtime: Util.RuntimeOptions): GetSuppressionListLevelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSuppressionListLevel',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取用户无效地址级别配置
 *
 * @param request GetSuppressionListLevelRequest
 * @return GetSuppressionListLevelResponse
 */
async function getSuppressionListLevel(request: GetSuppressionListLevelRequest): GetSuppressionListLevelResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSuppressionListLevelWithOptions(request, runtime);
}

model GetTrackListRequest {
  accountName?: string(name='AccountName'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2019-09-29'),
  offset?: string(name='Offset'),
  offsetCreateTime?: string(name='OffsetCreateTime'),
  offsetCreateTimeDesc?: string(name='OffsetCreateTimeDesc'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2019-09-29'),
  tagName?: string(name='TagName'),
  total?: string(name='Total'),
}

model GetTrackListResponseBody = {
  offsetCreateTime?: string(name='OffsetCreateTime'),
  offsetCreateTimeDesc?: string(name='OffsetCreateTimeDesc'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
  total?: int32(name='Total', example='100'),
  data?: {
    stat?: [ 
    {
      createTime?: string(name='CreateTime', example='2019-09-29T13:28Z'),
      rcptClickCount?: string(name='RcptClickCount', example='0'),
      rcptClickRate?: string(name='RcptClickRate', example='0'),
      rcptOpenCount?: string(name='RcptOpenCount', example='0'),
      rcptOpenRate?: string(name='RcptOpenRate', example='0'),
      rcptUniqueClickCount?: string(name='RcptUniqueClickCount', example='0'),
      rcptUniqueClickRate?: string(name='RcptUniqueClickRate', example='0'),
      rcptUniqueOpenCount?: string(name='RcptUniqueOpenCount', example='0'),
      rcptUniqueOpenRate?: string(name='RcptUniqueOpenRate', example='0'),
      totalNumber?: string(name='TotalNumber', example='0'),
    }
  ](name='stat')
  }(name='data'),
}

model GetTrackListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTrackListResponseBody(name='body'),
}

/**
 * @summary 获取跟踪信息
 *
 * @param request GetTrackListRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTrackListResponse
 */
async function getTrackListWithOptions(request: GetTrackListRequest, runtime: Util.RuntimeOptions): GetTrackListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.offsetCreateTime)) {
    query['OffsetCreateTime'] = request.offsetCreateTime;
  }
  if (!Util.isUnset(request.offsetCreateTimeDesc)) {
    query['OffsetCreateTimeDesc'] = request.offsetCreateTimeDesc;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  if (!Util.isUnset(request.total)) {
    query['Total'] = request.total;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTrackList',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取跟踪信息
 *
 * @param request GetTrackListRequest
 * @return GetTrackListResponse
 */
async function getTrackList(request: GetTrackListRequest): GetTrackListResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTrackListWithOptions(request, runtime);
}

model GetTrackListByMailFromAndTagNameRequest {
  accountName?: string(name='AccountName', example='e-service@amegroups.cn'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2019-09-29'),
  offset?: string(name='Offset'),
  offsetCreateTime?: string(name='OffsetCreateTime'),
  offsetCreateTimeDesc?: string(name='OffsetCreateTimeDesc'),
  ownerId?: long(name='OwnerId'),
  pageNumber?: string(name='PageNumber', example='1'),
  pageSize?: string(name='PageSize', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2019-09-29'),
  tagName?: string(name='TagName', example='Subscription'),
  total?: string(name='Total'),
}

model GetTrackListByMailFromAndTagNameResponseBody = {
  offsetCreateTime?: string(name='OffsetCreateTime'),
  offsetCreateTimeDesc?: string(name='OffsetCreateTimeDesc'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='20'),
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
  total?: int32(name='Total', example='4'),
  trackList?: {
    stat?: [ 
    {
      createTime?: string(name='CreateTime', example='2022-01-11T10:11Z'),
      rcptClickCount?: string(name='RcptClickCount', example='0'),
      rcptClickRate?: string(name='RcptClickRate', example='0'),
      rcptOpenCount?: string(name='RcptOpenCount', example='0'),
      rcptOpenRate?: string(name='RcptOpenRate', example='0'),
      rcptUniqueClickCount?: string(name='RcptUniqueClickCount', example='0'),
      rcptUniqueClickRate?: string(name='RcptUniqueClickRate', example='0'),
      rcptUniqueOpenCount?: string(name='RcptUniqueOpenCount', example='0'),
      rcptUniqueOpenRate?: string(name='RcptUniqueOpenRate', example='0'),
      totalNumber?: string(name='TotalNumber', example='0'),
    }
  ](name='Stat')
  }(name='TrackList'),
}

model GetTrackListByMailFromAndTagNameResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTrackListByMailFromAndTagNameResponseBody(name='body'),
}

/**
 * @summary 根据发信地址和Tag名称获取跟踪信息
 *
 * @param request GetTrackListByMailFromAndTagNameRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTrackListByMailFromAndTagNameResponse
 */
async function getTrackListByMailFromAndTagNameWithOptions(request: GetTrackListByMailFromAndTagNameRequest, runtime: Util.RuntimeOptions): GetTrackListByMailFromAndTagNameResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.offset)) {
    query['Offset'] = request.offset;
  }
  if (!Util.isUnset(request.offsetCreateTime)) {
    query['OffsetCreateTime'] = request.offsetCreateTime;
  }
  if (!Util.isUnset(request.offsetCreateTimeDesc)) {
    query['OffsetCreateTimeDesc'] = request.offsetCreateTimeDesc;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  if (!Util.isUnset(request.total)) {
    query['Total'] = request.total;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTrackListByMailFromAndTagName',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据发信地址和Tag名称获取跟踪信息
 *
 * @param request GetTrackListByMailFromAndTagNameRequest
 * @return GetTrackListByMailFromAndTagNameResponse
 */
async function getTrackListByMailFromAndTagName(request: GetTrackListByMailFromAndTagNameRequest): GetTrackListByMailFromAndTagNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTrackListByMailFromAndTagNameWithOptions(request, runtime);
}

model GetUserResponseBody = {
  data?: {
    enableEventbridge?: boolean(name='EnableEventbridge', description='Whether EventBridge is enabled', example='true'),
  }(name='Data', description='Returned Content'),
  requestId?: string(name='RequestId', description='Request ID', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model GetUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserResponseBody(name='body'),
}

/**
 * @summary Get Account Details
 *
 * @param request GetUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUserResponse
 */
async function getUserWithOptions(runtime: Util.RuntimeOptions): GetUserResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetUser',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Get Account Details
 *
 * @return GetUserResponse
 */
async function getUser(): GetUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserWithOptions(runtime);
}

model ListUserSuppressionRequest {
  address?: string(name='Address', description='Email address or domain name', example='test@example.net'),
  endBounceTime?: int32(name='EndBounceTime', description='End time of the last bounce hit, timestamp, accurate to the second. The span between start and end times cannot exceed 7 days.', example='1715669077'),
  endCreateTime?: int32(name='EndCreateTime', description='End creation time, timestamp, accurate to the second. The span between start and end times cannot exceed 7 days.', example='1715669077'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', description='Current page number', example='1'),
  pageSize?: int32(name='PageSize', description='Page size', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startBounceTime?: int32(name='StartBounceTime', description='Start time of the last bounce hit, timestamp, accurate to the second.', example='1715668852'),
  startCreateTime?: int32(name='StartCreateTime', description='Start creation time, timestamp, accurate to the second.', example='1715668852'),
}

model ListUserSuppressionResponseBody = {
  data?: {
    userSuppressions?: [ 
    {
      address?: string(name='Address', description='Email address or domain name', example='test@example.net'),
      createTime?: int32(name='CreateTime', description='Creation time, timestamp, accurate to the second.', example='1715667435'),
      lastBounceTime?: int32(name='LastBounceTime', description='Last bounce hit time, timestamp, accurate to the second.', example='1715667451'),
      suppressionId?: int32(name='SuppressionId', description='Invalid address ID', example='59511'),
      type?: string(name='Type', description='Source of entry, invalid address type
- system
- user', example='user'),
    }
  ](name='UserSuppressions')
  }(name='Data', description='Returned results.'),
  pageNumber?: int32(name='PageNumber', description='Page number', example='1'),
  pageSize?: int32(name='PageSize', description='Page size', example='10'),
  requestId?: string(name='RequestId', description='Request ID', example='1A846D66-5EC7-551B-9687-5BF1963DCFC1'),
  totalCount?: int32(name='TotalCount', description='Total count', example='2'),
}

model ListUserSuppressionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserSuppressionResponseBody(name='body'),
}

/**
 * @summary List User Invalid Addresses.
 *
 * @param request ListUserSuppressionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserSuppressionResponse
 */
async function listUserSuppressionWithOptions(request: ListUserSuppressionRequest, runtime: Util.RuntimeOptions): ListUserSuppressionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.endBounceTime)) {
    query['EndBounceTime'] = request.endBounceTime;
  }
  if (!Util.isUnset(request.endCreateTime)) {
    query['EndCreateTime'] = request.endCreateTime;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startBounceTime)) {
    query['StartBounceTime'] = request.startBounceTime;
  }
  if (!Util.isUnset(request.startCreateTime)) {
    query['StartCreateTime'] = request.startCreateTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUserSuppression',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary List User Invalid Addresses.
 *
 * @param request ListUserSuppressionRequest
 * @return ListUserSuppressionResponse
 */
async function listUserSuppression(request: ListUserSuppressionRequest): ListUserSuppressionResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUserSuppressionWithOptions(request, runtime);
}

model ModifyMailAddressRequest {
  mailAddressId?: int32(name='MailAddressId', description='This parameter is required.', example='1344565'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password', example='pwd129WDCft9'),
  replyAddress?: string(name='ReplyAddress', example='a***@example.net'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyMailAddressResponseBody = {
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model ModifyMailAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyMailAddressResponseBody(name='body'),
}

/**
 * @summary 修改发信地址
 *
 * @param request ModifyMailAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyMailAddressResponse
 */
async function modifyMailAddressWithOptions(request: ModifyMailAddressRequest, runtime: Util.RuntimeOptions): ModifyMailAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mailAddressId)) {
    query['MailAddressId'] = request.mailAddressId;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.replyAddress)) {
    query['ReplyAddress'] = request.replyAddress;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyMailAddress',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改发信地址
 *
 * @param request ModifyMailAddressRequest
 * @return ModifyMailAddressResponse
 */
async function modifyMailAddress(request: ModifyMailAddressRequest): ModifyMailAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyMailAddressWithOptions(request, runtime);
}

model ModifyPWByDomainRequest {
  domainName?: string(name='DomainName', description='This parameter is required.', example='abc.com'),
  ownerId?: long(name='OwnerId'),
  password?: string(name='Password', description='This parameter is required.', example='pwd'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model ModifyPWByDomainResponseBody = {
  code?: string(name='Code', example='OK'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='02B2A890-CBD8-4806-9BCA-C93190CE7EF6'),
  success?: boolean(name='Success', example='true'),
}

model ModifyPWByDomainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyPWByDomainResponseBody(name='body'),
}

/**
 * @summary 修改域级别密码
 *
 * @param request ModifyPWByDomainRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyPWByDomainResponse
 */
async function modifyPWByDomainWithOptions(request: ModifyPWByDomainRequest, runtime: Util.RuntimeOptions): ModifyPWByDomainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.domainName)) {
    query['DomainName'] = request.domainName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.password)) {
    query['Password'] = request.password;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyPWByDomain',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改域级别密码
 *
 * @param request ModifyPWByDomainRequest
 * @return ModifyPWByDomainResponse
 */
async function modifyPWByDomain(request: ModifyPWByDomainRequest): ModifyPWByDomainResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyPWByDomainWithOptions(request, runtime);
}

model ModifyTagRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  tagDescription?: string(name='TagDescription'),
  tagId?: int32(name='TagId', description='The ID of the tag.

This parameter is required.', example='123'),
  tagName?: string(name='TagName', description='The name of the tag.

This parameter is required.', example='vme'),
}

model ModifyTagResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model ModifyTagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyTagResponseBody(name='body'),
}

/**
 * @summary 修改标签
 *
 * @param request ModifyTagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ModifyTagResponse
 */
async function modifyTagWithOptions(request: ModifyTagRequest, runtime: Util.RuntimeOptions): ModifyTagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.tagDescription)) {
    query['TagDescription'] = request.tagDescription;
  }
  if (!Util.isUnset(request.tagId)) {
    query['TagId'] = request.tagId;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyTag',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 修改标签
 *
 * @param request ModifyTagRequest
 * @return ModifyTagResponse
 */
async function modifyTag(request: ModifyTagRequest): ModifyTagResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyTagWithOptions(request, runtime);
}

model QueryDomainByParamRequest {
  keyWord?: string(name='KeyWord', example='abc.com'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: int32(name='Status', example='0'),
}

model QueryDomainByParamResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='50'),
  requestId?: string(name='RequestId', example='8C90CCD3-627C-4F87-AD8C-2F03146071EB'),
  totalCount?: int32(name='TotalCount', example='2'),
  data?: {
    domain?: [ 
    {
      cnameAuthStatus?: string(name='CnameAuthStatus', example='0'),
      confirmStatus?: string(name='ConfirmStatus', example='0'),
      createTime?: string(name='CreateTime', example='2019-09-29T13:28Z'),
      domainId?: string(name='DomainId', example='158923'),
      domainName?: string(name='DomainName', example='vmeixme.com'),
      domainRecord?: string(name='DomainRecord', example='6bd86901b9fe4618a046'),
      domainStatus?: string(name='DomainStatus', example='0'),
      icpStatus?: string(name='IcpStatus', example='1'),
      mxAuthStatus?: string(name='MxAuthStatus', example='0'),
      spfAuthStatus?: string(name='SpfAuthStatus', example='0'),
      utcCreateTime?: long(name='UtcCreateTime', example='1569734892'),
    }
  ](name='domain')
  }(name='data'),
}

model QueryDomainByParamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryDomainByParamResponseBody(name='body'),
}

/**
 * @summary 查询域名信息
 *
 * @param request QueryDomainByParamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryDomainByParamResponse
 */
async function queryDomainByParamWithOptions(request: QueryDomainByParamRequest, runtime: Util.RuntimeOptions): QueryDomainByParamResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryDomainByParam',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询域名信息
 *
 * @param request QueryDomainByParamRequest
 * @return QueryDomainByParamResponse
 */
async function queryDomainByParam(request: QueryDomainByParamRequest): QueryDomainByParamResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryDomainByParamWithOptions(request, runtime);
}

model QueryInvalidAddressRequest {
  endTime?: string(name='EndTime', example='2019-09-29'),
  keyWord?: string(name='KeyWord', example='info'),
  length?: int32(name='Length', example='100'),
  nextStart?: string(name='NextStart', example='***'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', example='2019-09-29'),
}

model QueryInvalidAddressResponseBody = {
  nextStart?: string(name='NextStart', example='2'),
  requestId?: string(name='RequestId', example='95A7D497-F8DD-4834-B81E-C1783236E55F'),
  totalCount?: int32(name='TotalCount', example='3'),
  data?: {
    mailDetail?: [ 
    {
      lastUpdateTime?: string(name='LastUpdateTime', example='2021-04-28T17:11Z'),
      toAddress?: string(name='ToAddress', example='toaddress@test.com'),
      utcLastUpdateTime?: long(name='UtcLastUpdateTime', example='1619601108'),
    }
  ](name='mailDetail')
  }(name='data'),
}

model QueryInvalidAddressResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryInvalidAddressResponseBody(name='body'),
}

/**
 * @summary NextStart修改为string
 *
 * @param request QueryInvalidAddressRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryInvalidAddressResponse
 */
async function queryInvalidAddressWithOptions(request: QueryInvalidAddressRequest, runtime: Util.RuntimeOptions): QueryInvalidAddressResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!Util.isUnset(request.length)) {
    query['Length'] = request.length;
  }
  if (!Util.isUnset(request.nextStart)) {
    query['NextStart'] = request.nextStart;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryInvalidAddress',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary NextStart修改为string
 *
 * @param request QueryInvalidAddressRequest
 * @return QueryInvalidAddressResponse
 */
async function queryInvalidAddress(request: QueryInvalidAddressRequest): QueryInvalidAddressResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryInvalidAddressWithOptions(request, runtime);
}

model QueryMailAddressByParamRequest {
  keyWord?: string(name='KeyWord'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  sendtype?: string(name='Sendtype', example='batch'),
}

model QueryMailAddressByParamResponseBody = {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='95A7D497-F8DD-4834-B81E-C1783236E55F'),
  totalCount?: int32(name='TotalCount', example='2'),
  data?: {
    mailAddress?: [ 
    {
      accountName?: string(name='AccountName'),
      accountStatus?: string(name='AccountStatus', example='0'),
      createTime?: string(name='CreateTime', example='2019-09-29T13:28Z'),
      dailyCount?: string(name='DailyCount', example='10000'),
      dailyReqCount?: string(name='DailyReqCount', example='100'),
      domainStatus?: string(name='DomainStatus', example='0'),
      mailAddressId?: string(name='MailAddressId', example='12122'),
      monthCount?: string(name='MonthCount', example='300000'),
      monthReqCount?: string(name='MonthReqCount', example='20000'),
      replyAddress?: string(name='ReplyAddress', example='112@aliyun.com'),
      replyStatus?: string(name='ReplyStatus', example='0'),
      sendtype?: string(name='Sendtype', example='batch'),
    }
  ](name='mailAddress')
  }(name='data'),
}

model QueryMailAddressByParamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryMailAddressByParamResponseBody(name='body'),
}

/**
 * @param request QueryMailAddressByParamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryMailAddressByParamResponse
 */
async function queryMailAddressByParamWithOptions(request: QueryMailAddressByParamRequest, runtime: Util.RuntimeOptions): QueryMailAddressByParamResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.sendtype)) {
    query['Sendtype'] = request.sendtype;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryMailAddressByParam',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryMailAddressByParamRequest
 * @return QueryMailAddressByParamResponse
 */
async function queryMailAddressByParam(request: QueryMailAddressByParamRequest): QueryMailAddressByParamResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryMailAddressByParamWithOptions(request, runtime);
}

model QueryReceiverByParamRequest {
  keyWord?: string(name='KeyWord', example='mesh-notification'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: int32(name='Status', example='1'),
}

model QueryReceiverByParamResponseBody = {
  nextStart?: string(name='NextStart', example='6aec200853#102#1638894326#rdwilbur@verizon.net'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
  totalCount?: int32(name='TotalCount', example='15'),
  data?: {
    receiver?: [ 
    {
      count?: string(name='Count', example='3'),
      createTime?: string(name='CreateTime', example='2019-09-29T13:28Z'),
      desc?: string(name='Desc'),
      receiverId?: string(name='ReceiverId', example='0c910a7143044b1e116719eb678907b3'),
      receiversAlias?: string(name='ReceiversAlias', example='10***@163.com'),
      receiversName?: string(name='ReceiversName', example='TKP000442-333'),
      receiversStatus?: string(name='ReceiversStatus', example='0'),
      utcCreateTime?: long(name='UtcCreateTime', example='1569734892'),
    }
  ](name='receiver')
  }(name='data'),
}

model QueryReceiverByParamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryReceiverByParamResponseBody(name='body'),
}

/**
 * @summary 查询收信人列表详情
 *
 * @param request QueryReceiverByParamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryReceiverByParamResponse
 */
async function queryReceiverByParamWithOptions(request: QueryReceiverByParamRequest, runtime: Util.RuntimeOptions): QueryReceiverByParamResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryReceiverByParam',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询收信人列表详情
 *
 * @param request QueryReceiverByParamRequest
 * @return QueryReceiverByParamResponse
 */
async function queryReceiverByParam(request: QueryReceiverByParamRequest): QueryReceiverByParamResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryReceiverByParamWithOptions(request, runtime);
}

model QueryReceiverDetailRequest {
  keyWord?: string(name='KeyWord', example='b***@example.net'),
  nextStart?: string(name='NextStart', example='0'),
  ownerId?: long(name='OwnerId'),
  pageSize?: int32(name='PageSize', example='10'),
  receiverId?: string(name='ReceiverId', description='This parameter is required.', example='1235'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryReceiverDetailResponseBody = {
  dataSchema?: string(name='DataSchema', example='UserName,NickName,Gender,Birthday,Mobile'),
  nextStart?: string(name='NextStart', example='90f0243616#401#b68c2af70b9664b2843f90fd3630b1a3-1650779410#xxx@demo.aliyun.com'),
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
  totalCount?: int32(name='TotalCount', example='361'),
  data?: {
    detail?: [ 
    {
      createTime?: string(name='CreateTime', example='2019-09-29T13:28Z'),
      data?: string(name='Data', example='{\\\\"Domains\\\\": [\\\\"a.example.net\\\\", \\\\"b.example.net\\\\", \\\\"c.example.net\\\\", \\\\"d.example.net\\\\"]}'),
      email?: string(name='Email', example='a***@example.net'),
      utcCreateTime?: long(name='UtcCreateTime', example='1569734892'),
    }
  ](name='detail')
  }(name='data'),
}

model QueryReceiverDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryReceiverDetailResponseBody(name='body'),
}

/**
 * @summary 查询收信人列表详情信息
 *
 * @param request QueryReceiverDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryReceiverDetailResponse
 */
async function queryReceiverDetailWithOptions(request: QueryReceiverDetailRequest, runtime: Util.RuntimeOptions): QueryReceiverDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!Util.isUnset(request.nextStart)) {
    query['NextStart'] = request.nextStart;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.receiverId)) {
    query['ReceiverId'] = request.receiverId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryReceiverDetail',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询收信人列表详情信息
 *
 * @param request QueryReceiverDetailRequest
 * @return QueryReceiverDetailResponse
 */
async function queryReceiverDetail(request: QueryReceiverDetailRequest): QueryReceiverDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryReceiverDetailWithOptions(request, runtime);
}

model QueryTagByParamRequest {
  keyWord?: string(name='KeyWord', example='1aTag'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model QueryTagByParamResponseBody = {
  pageNumber?: int32(name='PageNumber', example='5'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
  totalCount?: int32(name='TotalCount', example='2'),
  data?: {
    tag?: [ 
    {
      tagDescription?: string(name='TagDescription'),
      tagId?: string(name='TagId', example='52366'),
      tagName?: string(name='TagName', example='hellopal'),
    }
  ](name='tag')
  }(name='data'),
}

model QueryTagByParamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTagByParamResponseBody(name='body'),
}

/**
 * @param request QueryTagByParamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTagByParamResponse
 */
async function queryTagByParamWithOptions(request: QueryTagByParamRequest, runtime: Util.RuntimeOptions): QueryTagByParamResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTagByParam',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryTagByParamRequest
 * @return QueryTagByParamResponse
 */
async function queryTagByParam(request: QueryTagByParamRequest): QueryTagByParamResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTagByParamWithOptions(request, runtime);
}

model QueryTaskByParamRequest {
  keyWord?: string(name='KeyWord', example='mesh-notification-788717'),
  ownerId?: long(name='OwnerId'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  status?: int32(name='Status', example='0'),
}

model QueryTaskByParamResponseBody = {
  pageNumber?: int32(name='PageNumber', example='3'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
  totalCount?: int32(name='TotalCount', example='15'),
  data?: {
    task?: [ 
    {
      addressType?: string(name='AddressType'),
      createTime?: string(name='CreateTime'),
      receiversName?: string(name='ReceiversName', example='TKP000442-333'),
      requestCount?: string(name='RequestCount', example='1'),
      tagName?: string(name='TagName', example='202201'),
      taskId?: string(name='TaskId', example='1054296'),
      taskStatus?: string(name='TaskStatus', example='1'),
      templateName?: string(name='TemplateName', example='Short Simple'),
      utcCreateTime?: long(name='UtcCreateTime', example='1569734892'),
    }
  ](name='task')
  }(name='data'),
}

model QueryTaskByParamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTaskByParamResponseBody(name='body'),
}

/**
 * @param request QueryTaskByParamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return QueryTaskByParamResponse
 */
async function queryTaskByParamWithOptions(request: QueryTaskByParamRequest, runtime: Util.RuntimeOptions): QueryTaskByParamResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTaskByParam',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request QueryTaskByParamRequest
 * @return QueryTaskByParamResponse
 */
async function queryTaskByParam(request: QueryTaskByParamRequest): QueryTaskByParamResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTaskByParamWithOptions(request, runtime);
}

model RemoveUserSuppressionRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  suppressionIds?: string(name='SuppressionIds', example='59511'),
}

model RemoveUserSuppressionResponseBody = {
  requestId?: string(name='RequestId', example='1A846D66-5EC7-551B-9687-5BF1963DCFC1'),
}

model RemoveUserSuppressionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveUserSuppressionResponseBody(name='body'),
}

/**
 * @summary 删除用户无效地址
 *
 * @param request RemoveUserSuppressionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return RemoveUserSuppressionResponse
 */
async function removeUserSuppressionWithOptions(request: RemoveUserSuppressionRequest, runtime: Util.RuntimeOptions): RemoveUserSuppressionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.suppressionIds)) {
    query['SuppressionIds'] = request.suppressionIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveUserSuppression',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 删除用户无效地址
 *
 * @param request RemoveUserSuppressionRequest
 * @return RemoveUserSuppressionResponse
 */
async function removeUserSuppression(request: RemoveUserSuppressionRequest): RemoveUserSuppressionResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeUserSuppressionWithOptions(request, runtime);
}

model SaveReceiverDetailRequest {
  detail?: string(name='Detail', description='This parameter is required.', example='[{“b”:” birthday”,”e”:”xxx@alibaba-inc.com”,”g”:” gender”,”m”:” mobile “,”n”:” nickname “,”u”:”name “}]'),
  ownerId?: long(name='OwnerId'),
  receiverId?: string(name='ReceiverId', description='This parameter is required.', example='34642'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model SaveReceiverDetailResponseBody = {
  data?: {
    detail?: [ 
    {
      email?: string(name='Email', example='test@mail.com'),
    }
  ](name='Detail')
  }(name='Data'),
  errorCount?: int32(name='ErrorCount', example='638'),
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
  successCount?: int32(name='SuccessCount', example='274'),
}

model SaveReceiverDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveReceiverDetailResponseBody(name='body'),
}

/**
 * @summary 建单个收件人
 *
 * @param request SaveReceiverDetailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SaveReceiverDetailResponse
 */
async function saveReceiverDetailWithOptions(request: SaveReceiverDetailRequest, runtime: Util.RuntimeOptions): SaveReceiverDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.detail)) {
    query['Detail'] = request.detail;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.receiverId)) {
    query['ReceiverId'] = request.receiverId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SaveReceiverDetail',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 建单个收件人
 *
 * @param request SaveReceiverDetailRequest
 * @return SaveReceiverDetailResponse
 */
async function saveReceiverDetail(request: SaveReceiverDetailRequest): SaveReceiverDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveReceiverDetailWithOptions(request, runtime);
}

model SendTestByTemplateRequest {
  accountName?: string(name='AccountName', description='This parameter is required.'),
  birthday?: string(name='Birthday', example='2000/01/01'),
  email?: string(name='Email', description='This parameter is required.'),
  gender?: string(name='Gender'),
  mobile?: string(name='Mobile', example='1380000****'),
  nickName?: string(name='NickName'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  templateId?: int32(name='TemplateId', description='This parameter is required.', example='123'),
  userName?: string(name='UserName'),
}

model SendTestByTemplateResponseBody = {
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
}

model SendTestByTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendTestByTemplateResponseBody(name='body'),
}

/**
 * @summary 发送模板测试邮件
 *
 * @param request SendTestByTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SendTestByTemplateResponse
 */
async function sendTestByTemplateWithOptions(request: SendTestByTemplateRequest, runtime: Util.RuntimeOptions): SendTestByTemplateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.birthday)) {
    query['Birthday'] = request.birthday;
  }
  if (!Util.isUnset(request.email)) {
    query['Email'] = request.email;
  }
  if (!Util.isUnset(request.gender)) {
    query['Gender'] = request.gender;
  }
  if (!Util.isUnset(request.mobile)) {
    query['Mobile'] = request.mobile;
  }
  if (!Util.isUnset(request.nickName)) {
    query['NickName'] = request.nickName;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.templateId)) {
    query['TemplateId'] = request.templateId;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendTestByTemplate',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 发送模板测试邮件
 *
 * @param request SendTestByTemplateRequest
 * @return SendTestByTemplateResponse
 */
async function sendTestByTemplate(request: SendTestByTemplateRequest): SendTestByTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendTestByTemplateWithOptions(request, runtime);
}

model SenderStatisticsByTagNameAndBatchIDRequest {
  accountName?: string(name='AccountName', example='xxx'),
  endTime?: string(name='EndTime', description='This parameter is required.', example='2019-09-29'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='This parameter is required.', example='2019-09-29'),
  tagName?: string(name='TagName', example='xxx'),
}

model SenderStatisticsByTagNameAndBatchIDResponseBody = {
  requestId?: string(name='RequestId', example='10A1AD70-E48E-476D-98D9-39BD92193837'),
  totalCount?: int32(name='TotalCount', example='1'),
  data?: {
    stat?: [ 
    {
      createTime?: string(name='CreateTime', example='2021-07-02'),
      faildCount?: string(name='faildCount', example='0'),
      requestCount?: string(name='requestCount', example='4'),
      succeededPercent?: string(name='succeededPercent', example='100.00%'),
      successCount?: string(name='successCount', example='4'),
      unavailableCount?: string(name='unavailableCount', example='0'),
      unavailablePercent?: string(name='unavailablePercent', example='0%'),
    }
  ](name='stat')
  }(name='data'),
}

model SenderStatisticsByTagNameAndBatchIDResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SenderStatisticsByTagNameAndBatchIDResponseBody(name='body'),
}

/**
 * @summary 获取指定条件下的发送数据
 *
 * @param request SenderStatisticsByTagNameAndBatchIDRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SenderStatisticsByTagNameAndBatchIDResponse
 */
async function senderStatisticsByTagNameAndBatchIDWithOptions(request: SenderStatisticsByTagNameAndBatchIDRequest, runtime: Util.RuntimeOptions): SenderStatisticsByTagNameAndBatchIDResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SenderStatisticsByTagNameAndBatchID',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 获取指定条件下的发送数据
 *
 * @param request SenderStatisticsByTagNameAndBatchIDRequest
 * @return SenderStatisticsByTagNameAndBatchIDResponse
 */
async function senderStatisticsByTagNameAndBatchID(request: SenderStatisticsByTagNameAndBatchIDRequest): SenderStatisticsByTagNameAndBatchIDResponse {
  var runtime = new Util.RuntimeOptions{};
  return senderStatisticsByTagNameAndBatchIDWithOptions(request, runtime);
}

model SenderStatisticsDetailByParamRequest {
  accountName?: string(name='AccountName', description='Sending address. Not filled in represents all addresses.', example='s***@example.net'),
  endTime?: string(name='EndTime', description='The end time. The difference between the start time and the end time cannot exceed 30 days. Format: yyyy-MM-dd.', example='2021-04-29 00:00'),
  length?: int32(name='Length', description='The number of entries to return in the request. Valid values: 1 to 100.', example='5'),
  nextStart?: string(name='NextStart', description='The start position of the next page. The offset for the request. If you want to obtain more records, specify the return value of the NextStart parameter for this parameter.', example='90f0243616#203#a***@example.net-1658817837#a***@example.net.247475288187'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  startTime?: string(name='StartTime', description='The start time. The start time can be up to 30 days earlier than the current time. Format: yyyy-MM-dd.', example='2021-04-28 00:00'),
  status?: int32(name='Status', description='The delivery status. If you leave this parameter empty, all states are included. Valid values: 0: successful, 2 invalid email address, 3: spam, and 4: failed.', example='0'),
  tagName?: string(name='TagName', description='The email tag. If you leave this parameter empty, all email tags are included.', example='EmailQuestionnaireHelioscam'),
  toAddress?: string(name='ToAddress', description='The recipient address. If you leave this parameter empty, all recipient addresses are included.', example='b***@example.net'),
}

model SenderStatisticsDetailByParamResponseBody = {
  nextStart?: string(name='NextStart', description='The start position of the next page. The return value of the NextStart parameter indicates the start position of the next page. If you want to obtain more records, specify the return value in the next request.', example='90f0243616#203#a***@example.net-1658817689#a***@example.net.247141122178'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='B5AB8EBB-EE64-4BB2-B085-B92CC5DEDC41'),
  data?: {
    mailDetail?: [ 
    {
      accountName?: string(name='AccountName', description='The sender address.', example='s***@example.net'),
      errorClassification?: string(name='ErrorClassification', description='Detailed classification of error causes:

- SendOk
- SmtpNxBox

etc.', example='SendOk'),
      lastUpdateTime?: string(name='LastUpdateTime', description='The most recent update time.', example='2021-04-28T17:11Z'),
      message?: string(name='Message', description='The details of the email.', example='250 Send Mail OK'),
      status?: int32(name='Status', description='The delivery status. Valid values: 0: successful, 2 invalid email address, 3: spam, and 4: failed.', example='0'),
      subject?: string(name='Subject', description='the subject of email.', example='test subject'),
      toAddress?: string(name='ToAddress', description='The recipient address.', example='b***@example.net'),
      utcLastUpdateTime?: string(name='UtcLastUpdateTime', description='The most recent update time (timestamp format)', example='1619601108'),
    }
  ](name='mailDetail')
  }(name='data', description='The response parameters.'),
}

model SenderStatisticsDetailByParamResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SenderStatisticsDetailByParamResponseBody(name='body'),
}

/**
 * @summary 查询投递结果详情
 *
 * @param request SenderStatisticsDetailByParamRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SenderStatisticsDetailByParamResponse
 */
async function senderStatisticsDetailByParamWithOptions(request: SenderStatisticsDetailByParamRequest, runtime: Util.RuntimeOptions): SenderStatisticsDetailByParamResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.length)) {
    query['Length'] = request.length;
  }
  if (!Util.isUnset(request.nextStart)) {
    query['NextStart'] = request.nextStart;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  if (!Util.isUnset(request.toAddress)) {
    query['ToAddress'] = request.toAddress;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SenderStatisticsDetailByParam',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询投递结果详情
 *
 * @param request SenderStatisticsDetailByParamRequest
 * @return SenderStatisticsDetailByParamResponse
 */
async function senderStatisticsDetailByParam(request: SenderStatisticsDetailByParamRequest): SenderStatisticsDetailByParamResponse {
  var runtime = new Util.RuntimeOptions{};
  return senderStatisticsDetailByParamWithOptions(request, runtime);
}

model SetSuppressionListLevelRequest {
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  suppressionListLevel?: string(name='SuppressionListLevel'),
}

model SetSuppressionListLevelResponseBody = {
  requestId?: string(name='RequestId'),
  suppressionListLevel?: string(name='SuppressionListLevel'),
}

model SetSuppressionListLevelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetSuppressionListLevelResponseBody(name='body'),
}

/**
 * @summary 设置用户无效地址级别配置
 *
 * @param request SetSuppressionListLevelRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetSuppressionListLevelResponse
 */
async function setSuppressionListLevelWithOptions(request: SetSuppressionListLevelRequest, runtime: Util.RuntimeOptions): SetSuppressionListLevelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.suppressionListLevel)) {
    query['SuppressionListLevel'] = request.suppressionListLevel;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetSuppressionListLevel',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 设置用户无效地址级别配置
 *
 * @param request SetSuppressionListLevelRequest
 * @return SetSuppressionListLevelResponse
 */
async function setSuppressionListLevel(request: SetSuppressionListLevelRequest): SetSuppressionListLevelResponse {
  var runtime = new Util.RuntimeOptions{};
  return setSuppressionListLevelWithOptions(request, runtime);
}

model SingleSendMailRequest {
  accountName?: string(name='AccountName', description='This parameter is required.', example='test@example.com'),
  addressType?: int32(name='AddressType', description='This parameter is required.', example='1'),
  clickTrace?: string(name='ClickTrace', example='0'),
  fromAlias?: string(name='FromAlias'),
  headers?: string(name='Headers'),
  htmlBody?: string(name='HtmlBody', example='body'),
  ownerId?: long(name='OwnerId'),
  replyAddress?: string(name='ReplyAddress', example='111@aliyun.com'),
  replyAddressAlias?: string(name='ReplyAddressAlias'),
  replyToAddress?: boolean(name='ReplyToAddress', description='This parameter is required.', example='true'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
  subject?: string(name='Subject', description='This parameter is required.', example='Subject'),
  tagName?: string(name='TagName', example='test'),
  textBody?: string(name='TextBody', example='12121'),
  toAddress?: string(name='ToAddress', description='This parameter is required.', example='test1@example.com'),
  unSubscribeFilterLevel?: string(name='UnSubscribeFilterLevel'),
  unSubscribeLinkType?: string(name='UnSubscribeLinkType'),
}

model SingleSendMailResponseBody = {
  envId?: string(name='EnvId', example='xxxxxx'),
  requestId?: string(name='RequestId', example='2D086F6-8F31-4658-84C1-006DED011A85'),
}

model SingleSendMailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SingleSendMailResponseBody(name='body'),
}

/**
 * @summary API发信
 *
 * @param request SingleSendMailRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SingleSendMailResponse
 */
async function singleSendMailWithOptions(request: SingleSendMailRequest, runtime: Util.RuntimeOptions): SingleSendMailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountName)) {
    query['AccountName'] = request.accountName;
  }
  if (!Util.isUnset(request.addressType)) {
    query['AddressType'] = request.addressType;
  }
  if (!Util.isUnset(request.clickTrace)) {
    query['ClickTrace'] = request.clickTrace;
  }
  if (!Util.isUnset(request.fromAlias)) {
    query['FromAlias'] = request.fromAlias;
  }
  if (!Util.isUnset(request.headers)) {
    query['Headers'] = request.headers;
  }
  if (!Util.isUnset(request.htmlBody)) {
    query['HtmlBody'] = request.htmlBody;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.replyAddress)) {
    query['ReplyAddress'] = request.replyAddress;
  }
  if (!Util.isUnset(request.replyAddressAlias)) {
    query['ReplyAddressAlias'] = request.replyAddressAlias;
  }
  if (!Util.isUnset(request.replyToAddress)) {
    query['ReplyToAddress'] = request.replyToAddress;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  if (!Util.isUnset(request.subject)) {
    query['Subject'] = request.subject;
  }
  if (!Util.isUnset(request.tagName)) {
    query['TagName'] = request.tagName;
  }
  if (!Util.isUnset(request.textBody)) {
    query['TextBody'] = request.textBody;
  }
  if (!Util.isUnset(request.toAddress)) {
    query['ToAddress'] = request.toAddress;
  }
  if (!Util.isUnset(request.unSubscribeFilterLevel)) {
    query['UnSubscribeFilterLevel'] = request.unSubscribeFilterLevel;
  }
  if (!Util.isUnset(request.unSubscribeLinkType)) {
    query['UnSubscribeLinkType'] = request.unSubscribeLinkType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SingleSendMail',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary API发信
 *
 * @param request SingleSendMailRequest
 * @return SingleSendMailResponse
 */
async function singleSendMail(request: SingleSendMailRequest): SingleSendMailResponse {
  var runtime = new Util.RuntimeOptions{};
  return singleSendMailWithOptions(request, runtime);
}

model UpdateIpProtectionRequest {
  ipProtection?: string(name='IpProtection', example='0'),
  ownerId?: long(name='OwnerId'),
  resourceOwnerAccount?: string(name='ResourceOwnerAccount'),
  resourceOwnerId?: long(name='ResourceOwnerId'),
}

model UpdateIpProtectionResponseBody = {
  requestId?: string(name='RequestId', example='B653A6FC-D1AD-5936-A262-F50994ED2574'),
}

model UpdateIpProtectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateIpProtectionResponseBody(name='body'),
}

/**
 * @summary 更新IP防护API
 *
 * @param request UpdateIpProtectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateIpProtectionResponse
 */
async function updateIpProtectionWithOptions(request: UpdateIpProtectionRequest, runtime: Util.RuntimeOptions): UpdateIpProtectionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.ipProtection)) {
    query['IpProtection'] = request.ipProtection;
  }
  if (!Util.isUnset(request.ownerId)) {
    query['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.resourceOwnerAccount)) {
    query['ResourceOwnerAccount'] = request.resourceOwnerAccount;
  }
  if (!Util.isUnset(request.resourceOwnerId)) {
    query['ResourceOwnerId'] = request.resourceOwnerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateIpProtection',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新IP防护API
 *
 * @param request UpdateIpProtectionRequest
 * @return UpdateIpProtectionResponse
 */
async function updateIpProtection(request: UpdateIpProtectionRequest): UpdateIpProtectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateIpProtectionWithOptions(request, runtime);
}

model UpdateUserRequest {
  user?: {
    enableEventbridge?: boolean(name='EnableEventbridge', description='Whether EventBridge is enabled', example='true'),
  }(name='User', description='User Information'),
}

model UpdateUserShrinkRequest {
  userShrink?: string(name='User', description='User Information'),
}

model UpdateUserResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='7BC346F6-1092-5852-B6E2-CCE2E5AAE51F'),
}

model UpdateUserResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateUserResponseBody(name='body'),
}

/**
 * @summary Update account information
 *
 * @param tmpReq UpdateUserRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateUserResponse
 */
async function updateUserWithOptions(tmpReq: UpdateUserRequest, runtime: Util.RuntimeOptions): UpdateUserResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateUserShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.user)) {
    request.userShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.user, 'User', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.userShrink)) {
    body['User'] = request.userShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateUser',
    version = '2015-11-23',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Update account information
 *
 * @param request UpdateUserRequest
 * @return UpdateUserResponse
 */
async function updateUser(request: UpdateUserRequest): UpdateUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateUserWithOptions(request, runtime);
}

